package com.zhupanlin.easyexcel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @author zhupanlin
 * @version 1.0
 * @description: TODO
 * @date 2024/11/21 22:30
 */
public class ExcelListener extends AnalysisEventListener<UserData> {

    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头信息：" + headMap);
    }

    // 一行一行的读取Excel的内容，从第二行开始读取
    @Override
    public void invoke(UserData userData, AnalysisContext analysisContext) {
        System.out.println(userData);
    }

    // 全部读取完之后会执行
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
